package com.yywq.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yywq.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author: 吴磊
 * @program: yywq
 * @create: 2021-03-20 22:20
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 通过电话查询用户（用于登录）
     *
     * @param telPhone
     * @return
     */
    User getUserByTelPhone(@Param("telPhone") String telPhone);

    /**
     * 插入用户
     *
     * @param user
     * @return
     */
    int insertUser(User user);

    /**
     * 通过ID获取用户
     *
     * @param id
     * @return
     */
    User getUserById(@Param("id") String id);

    /**
     * 根据手机号更新用户头像
     *
     * @param telPhone
     * @param userPicture
     * @return
     */
    int updateUserPicture(@Param("telPhone") String telPhone, @Param("userPicture") String userPicture);


}
